//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <elapi.h>

void * __cdecl operator new(size_t size)
{
    return _CMemoryHeap_Alloc(size, FALSE);
}

void * __cdecl operator new[](size_t size)
{
    return _CMemoryHeap_Alloc(size, FALSE);
}

void __cdecl operator delete(void *p)
{
    /* The C++ standard states that delete of a NULL pointer
     * must be harmless.
     */
    if (p != NULL) {
        (void)_CMemoryHeap_Free(p);
    }
    return ;
}

void __cdecl operator delete[](void *p)
{
    /* The C++ standard states that delete of a NULL pointer
     * must be harmless.
     */
    if (p != NULL) {
        (void)_CMemoryHeap_Free(p);
    }
    return ;
}

void* __cdecl operator new(size_t, void* _location)
{
    return _location;
}

void __cdecl operator delete(void*, void*)
{
}

